var form,$,table,layer;
var user = JSON.parse(localStorage.getItem('user'));
layui.use(['form','jquery','table','layer'],function() {
    form = layui.form;
    $ = layui.$;
    table = layui.table;
    layer = layui.layer;

    getToExamineProductMessages();
});

function getToExamineProductMessages(){
    var productId = $('#proId',window.parent.document).val();
    $.ajax({
        url:'/toExamine/getToExamineProductById',
        dataType:'json',
        data:{"productId": productId},
        success:function (data) {
            data = data.data;
            $('input[name = productCode]').val(data.productCode);
            $('input[name = productName]').val(data.productName);
            $('input[name = currentpriceProduct]').val("￥"+data.currentpriceProduct);
            $('input[name = title]').val(data.title);
            if(data.result == 0){
                data.result = "已删除";
            }else if(data.result == 1){
                data.result = "上架";
            }else{
                data.result = "下架";
            }
            $('input[name = result]').val(data.result);
            $('input[name = label]').val(data.productLabel);
            $('input[name = searchKeywords]').val(data.searchKeywords);
            $('input[name = hits]').val(data.hits);
            $('#productDescription').val(data.productDescription);
            if (data.mainImage != ''){
                $('#mainImage').html('<img src='+data.mainImage+' style="float:left; width:155px;"/>');
            }
        }
    });
}